In a network, a transmission path of a packet in a service flow is generally determined by means of mutual negotiation by network devices in the network and routing by the network devices themselves. Therefore, a network administrator is unaware of an actual transmission path of the packet. In a process of monitoring a packet, when a device that transmits the packet is faulty, an actual transmission path of the packet needs to be determined first, and then a faulty transmission path or device can be located accurately.
Generally, a transmission path of a packet is usually determined by sending a simulated packet. A source device may send a packet that carries Time To Live (TTL), that is, an Internet Control Message Protocol (ICMP) packet. After receiving the ICMP packet, a device on a transmission path subtracts 1 from the TTL in the ICMP packet. If the TTL in the ICMP packet is 0 after 1 is subtracted from the TTL, the device discards the ICMP packet and returns an ICMP Time Exceeded message to the source device; or, if the TTL in the ICMP packet is not 0 after 1 is subtracted from the TTL, the device forwards the ICMP packet. After the source device receives the ICMP Time Exceeded message, the source device learns that the device which sends the ICMP Time Exceeded message exists on the transmission path of the packet. The source device may determine different devices on the transmission path of the packet by sending simulated packets that carry different TTL, and further obtain the transmission path that includes the different devices and is of the packet.
However, in the foregoing method for determining a transmission path of a packet, because an ICMP packet sent by the source device is a simulated packet, a case may occur in which a transmission path of the simulated packet is different from an actual transmission path of the packet, causing that the transmission path that is determined by the source device and is of the packet is not accurate enough. In addition, a large quantity of simulated packets sent by the source device occupy a large amount of network bandwidth, which affects normal packet transmission.